<<<<<<< HEAD
<<<<<<< HEAD
<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:63:"C:\wamp200\www\xgwnew/application/index\view\address\index.html";i:1536891098;s:61:"C:\wamp200\www\xgwnew/application/index\view\public\base.html";i:1536557814;}*/ ?>
=======
<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:63:"C:\wamp200\www\xgwnew/application/index\view\address\index.html";i:1537104719;s:61:"C:\wamp200\www\xgwnew/application/index\view\public\base.html";i:1536844932;}*/ ?>
>>>>>>> df63b8e08acd14d1f9d8991f50e22eca3352cfef
=======
<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:63:"C:\wamp200\www\xgwnew/application/index\view\address\index.html";i:1537104999;s:61:"C:\wamp200\www\xgwnew/application/index\view\public\base.html";i:1536844932;}*/ ?>
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title><?php echo $title; ?></title>
<link rel="stylesheet" href="__PUBLIC__/xsd/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/icons-extra.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/app.css?v1111121" />

</head>
<!--/head-->
<body>


	<!--/header-->

<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/checkout.css" />
 <!-- <script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
 <script>
   $(function(){
    var geolocation = new qq.maps.Geolocation("QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH", "鲜果屋");
     geolocation.getIpLocation(showPosition, showErr)

   })

   function showPosition(position) {
     console.log(1111);
     $.getJSON("<?php echo url('index/cart/changecookie'); ?>", {name: 'positioninit', 'val': position.lat+','+position.lng}, function(json, textStatus) {});
  };
   function showErr() {
     console.log('定位失败');
   };
 </script> -->
 
 <!-- <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" charset="utf-8"></script>
<script>

    wx.config(<?php echo json_encode($wxoptions); ?>);

    wx.error(function(e){

      	console.log(e);

      });

    wx.getLocation({
    type: 'wgs84', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
    success: function (res) {
        var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
        var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
        var speed = res.speed; // 速度，以米/每秒计
        var accuracy = res.accuracy; // 位置精度
     //alert(JSON.stringify(res));
     
    
     $.get("http://apis.map.qq.com/ws/geocoder/v1/?location="+latitude+","+longitude+"&key=<?php echo $mapkey; ?>&get_poi=0&output=jsonp&callback=?",function(data) {
     console.log(data);
     if(data.status==0){
       var province = data.result.address_component.province;
     province = preg_replace('/市/',"",province);
     province = preg_replace('/省/',"",province);
     var city = data.result.address_component.city;
      city = preg_replace('/市/',"",city);
     var qu = data.result.address_component.district;
     $("#address1").val(province+" "+city+" "+qu);
     $("#address2").val(province+" "+city+" "+qu);
     
     }
     
    },'jsonp');   
      
    }
});
</script> -->

<style>
.addresscard-del {
    -ms-flex-preferred-size: 1.306667rem;
    flex-basis: 1.306667rem;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: end;
    -ms-flex-pack: end;
    justify-content: flex-end;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}
</style>
<header class="mui-bar mui-bar-nav" style="z-index:7">
    <a class=" mui-icon mui-icon-left-nav mui-pull-left " href="<?php echo $backurl; ?>" ></a>
    <h1 class="mui-title">选择地址</h1>
</header>
<div class="mui-content ">
    <?php if(is_array($list) || $list instanceof \think\Collection): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
    <div class="addresscard">
        <?php if($vo['defaults'] == '1'): ?>
        <div class="addresscard-select"><img src="__PUBLIC__/xsd/img/gg.png"></div><?php endif; ?>
        <div class="addresscard-body " data-addressid="<?php echo $vo['id']; ?>" <?php if($vo['defaults'] == '1'): ?>data-noc="1"<?php endif; ?>>
            <p class="addresscard-title"> <span class="username"><?php echo $vo['name']; ?></span> <span class="gender"><?php if($vo['sex'] == '1'): ?>先生<?php else: ?>女士<?php endif; ?></span> <span class="tpl"><?php echo $vo['tel']; ?></span> </p>
            <p class="addresscard-address"> <span class="address-tag" style="display: none;"></span> <span class="address-text"><?php echo $vo['address']; ?>-<?php echo $vo['house_number']; ?></span> </p>
        </div>
        <a class="addresscard-edit" href="<?php echo url('index/address/add', array('id'=>$vo['id'])); ?>"> <span class="mui-icon mui-icon-compose"></span></a>
        <a class="addresscard-del" href="javascript:;" data-id="<?php echo $vo['id']; ?>"> <span class="mui-icon mui-icon-trash"></span> </a>
    </div>
    <?php endforeach; endif; else: echo "" ;endif; ?>
    <div class="addressview-bottom">
        <div class="bottom-text" id="addaddress"><span class="mui-icon mui-icon-plus-filled"></span> 新增收货地址</div>
    </div>
</div>



<!--/#footer-->

<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/xsd/js/mui.min.js"></script>
<script src="__PUBLIC__/xsd/js/flexible.js"></script>
<script src="__PUBLIC__/xsd/js/template.js"></script>

  <script type="text/javascript">
    $(function(){
      $('#addaddress').on('click',function(){
<<<<<<< HEAD
<<<<<<< HEAD
      alert("aaa");
=======
      	alert("aa");
=======
      	//alert("aa");
>>>>>>> 37581d8edb7a0b22980c59b2b5580e0a44b60b5e
        window.location.href = "<?php echo url('index/address/add'); ?>"
>>>>>>> df63b8e08acd14d1f9d8991f50e22eca3352cfef
      })

      $('.addresscard-body').click(function(){
        var $this = $(this),id = $this.attr('data-addressid'),noc = $this.attr('data-noc');
        if(noc == 1){return ;}

        $.post("<?php echo url('index/address/setDefaults'); ?>", {
            "id": id
        }, function(data) {
            mui.toast('设为默认地址成功！')
            setTimeout(function() {
                //mui.back()
                self.location=document.referrer;
            }, 2000);

        }, "json");
      })

      $('.addresscard-del').on('click', function(){
        var id = $(this).attr('data-id')
        var btnArray = ['否', '是'];
        mui.confirm('您确定要删除地址吗？', '删除地址', btnArray, function(e) {
          if (e.index == 1) {
              $.post("<?php echo url('index/address/del'); ?>", {
                  "id": id
              }, function(data) {
                  mui.toast('删除成功！')
                  setTimeout(function() {
                    location.reload()
                  }, 2000);
              }, "json");

          } else {
            return ;
          }
        })
      })
    })
  </script>  
  
  
  <!-- <script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script> 
  <script>  
   $(function(){    
   	var geolocation = new qq.maps.Geolocation("QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH", "鲜果屋");     
   	geolocation.getIpLocation(showPosition, showErr)   })   
   	function showPosition(position) {     console.log(1111);     
   		$.getJSON("<?php echo url('index/cart/changecookie'); ?>", 
   		{name: 'positioninit', 'val': position.lat+','+position.lng}, 
   		function(json, textStatus) {});  };   
   		function showErr() {     console.log('定位失败');   }; 
   </script>
    -->
   
   

<?php if(!(empty(config('shop_hours')) || (config('shop_hours') instanceof \think\Collection && config('shop_hours')->isEmpty()))): ?>
<script>
  var time_range = function (beginTime, endTime) {
    var strb = beginTime.split (":");
    if (strb.length != 2) {
      return false;
    }

    var stre = endTime.split (":");
    if (stre.length != 2) {
      return false;
    }

    var b = new Date ();
    var e = new Date ();
    var n = new Date ();

    b.setHours (strb[0]);
    b.setMinutes (strb[1]);
    e.setHours (stre[0]);
    e.setMinutes (stre[1]);

    if (n.getTime () - b.getTime () > 0 && n.getTime () - e.getTime () < 0) {
      return true;
    } else {

      mui.alert("<?php echo config('shop_hours_message'); ?>", '公告');
      $('.mui-popup-buttons').html(' ')
      $('.mui-popup-inner').css('border-radius', '13px')
      return false;
    }
  }

  var shop_hours = "<?php echo config('shop_hours'); ?>";
  var hours_arr = shop_hours.split('-');
  time_range (hours_arr[0], hours_arr[1]);

</script>
<?php endif; if(config('is_rest') == '1'): ?>
<script>
mui.alert("<?php echo config('rest_message'); ?>", '公告');
$('.mui-popup-buttons').html(' ')
$('.mui-popup-inner').css('border-radius', '13px')
</script>
<?php endif; ?>



<script>
  $(function(){
    $('.subsc').click(function(){
      // $.get("<?php echo url('index/clearusersession'); ?>", function(data){
      //   if(data.code == 1){
      //     window.location.href = "http://mp.weixin.qq.com/s/-AzpDTU7eAD24-R5QUP0wg"
      //   }
      // })
      //cookie('goodsmodel_id', $model_id);
<<<<<<< HEAD
      <?php switch(cookie('goodsmodel_id')): case "1":case "2":case "3": ?>
=======
      <?php switch(cookie('goodsmodel_id')): case "1":case "2":case "21":case "22":case "3": ?>
>>>>>>> df63b8e08acd14d1f9d8991f50e22eca3352cfef
            mui.alert("<img src=<?php echo get_cover(config('frankserviceimg'), 'path'); ?> style='width:100%;'>", '长按扫二维码');
        <?php break; endswitch; if(!(empty($contact_qc) || ($contact_qc instanceof \think\Collection && $contact_qc->isEmpty()))): ?>
            mui.alert('<img src="<?php echo $contact_qc; ?>" style="width:100%;">', '长按扫二维码');
      <?php endif; ?>
    })


    $('.endlimit').each(function(){
      var $this = $(this);
      var stime = $this.attr('data-endtime');
      var starttime = new Date(stime.replace(/-/g,"/"))
      setInterval(function () {
        var nowtime = new Date();
        var time = starttime - nowtime;
        if(time > 0){
          var day = parseInt(time / 1000 / 60 / 60 / 24);
          var hour = parseInt(time / 1000 / 60 / 60 % 24);
          var minute = parseInt(time / 1000 / 60 % 60);
          var seconds = parseInt(time / 1000 % 60);
          $this.html("距结束还有:<span style='color:red'>"+ day + "天" + hour + "小时" + minute + "分钟" + seconds + "秒</span>");
        }

      }, 1000);
    })

    $('.hidecartbtn').each(function(){
      var id = $(this).attr('data-id')
      $('.cartbtn'+id).hide();
    })


  })
</script>

 

 <!-- <?php if(empty(\think\Cookie::get('positioninit')) || (\think\Cookie::get('positioninit') instanceof \think\Collection && \think\Cookie::get('positioninit')->isEmpty())): ?>
 <script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
 <script>
   $(function(){
    var geolocation = new qq.maps.Geolocation("QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH", "鲜果屋");
     geolocation.getIpLocation(showPosition, showErr)

   })

   function showPosition(position) {
     console.log(1111);
     $.getJSON("<?php echo url('index/cart/changecookie'); ?>", {name: 'positioninit', 'val': position.lat+','+position.lng}, function(json, textStatus) {});
  };
   function showErr() {
     console.log('定位失败');
   };
 </script>
 <?php endif; ?> -->

</body>
</html>
